<?

/**
 * Visualisation of the newsletter
 *
 * Defaults to most recent newsletter if no ID is provided
 * Caution: if ob_start is set and used, don't forget to alter the inflame handler
 *
 * @package Modules
 */

/**
 * Visualisation of the newsletter
 *
 * Defaults to most recent newsletter if no ID is provided
 *
 * @package Modules
 */
class NewsLetter extends MOD {

	function output () {
		global $DB, $Page, $Object;
		
		$Letter = new MAIL( "html" );
		$Object = ( $id = $_GET[ "id" ])?
			new Object( $this->vars->type, ( int ) $id ) : $DB->get_object( $this->vars->type, "active order by ID desc" );

		$Letter->generate_newsletter( $Object->id , LANG );
		
		$Page->set_cache( "title", $Object->get( 'name' ));
		
		return $Letter->html;			
	}
	
} 

?>


